import Vue from 'vue'
import VueRouter from 'vue-router'
import LoginPage from '../views/LoginPage.vue';
import IndexPage from '../views/IndexPage.vue';
import UserPage from '../views/UserPage.vue';
import ConfigPage from '../views/ConfigPage.vue';
import CategoryPage from '../views/CategoryPage.vue';
import ArticlePage from '../views/ArticlePage.vue';


Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'login',
    component: LoginPage
  },
  {
    path: '/index',
    name: 'index',
    component: IndexPage,
    children:[
      {
        path: '/user',
        name: 'user',
        component: UserPage
      },
      {
        path: '/category',
        name: 'category',
        component: CategoryPage
      },
      {
        path: '/article',
        name: 'article',
        component: ArticlePage
      },
      {
        path: '/config',
        name: 'config',
        component: ConfigPage
      },
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
